package com.bgs.service.impl;

import com.bgs.common.R;
import com.bgs.pojo.User;
import com.bgs.mapper.UserMapper;
import com.bgs.pojo.vo.FourUser;
import com.bgs.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 后台用户表 服务实现类
 * </p>
 *
 * @author Asia
 * @since 2021-09-14
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Resource
    private UserMapper userMapper;
    @Override
    public R findUser() {
        List<User> list=userMapper.findUser();
        return R.ok().data("data",list);
    }

    @Override
    public R addUser(User adduser) {
        boolean i= userMapper.addUser(adduser);
        return R.ok().data("data",i);
    }

    @Override
    public R fourFindUsers() {

        List<FourUser> list = userMapper.fourFindUsers();

        return R.ok().data("data",list);
    }
}
